//
// CondVar.cpp for  in /home/herpec_j/Dropbox/Projets/raytracer-2016/Sources/DesignPattern/ThreadPool/
//
// Made by Jonathan
// Login   <ledey_l@epitech.net>
//
// Started on  Fri Sep 20 13:41:59 2013 Jonathan
// Last update Fri Sep 20 13:46:41 2013 Jonathan
//

#include		<cstdlib>

#include		"DesignPattern/ThreadPool/CondVar.hpp"

namespace		DesignPattern
{
  namespace		ThreadPool
  {
    CondVar::CondVar(void)
    {
      pthread_cond_init(&mCondVar, NULL);
    }

    void		CondVar::Wait(pthread_mutex_t *rMutex)
    {
      pthread_cond_wait(&mCondVar, rMutex);
    }

    void		CondVar::Signal(void)
    {
      pthread_cond_signal(&mCondVar);
    }

    void		CondVar::Broadcast(void)
    {
      pthread_cond_broadcast(&mCondVar);
    }

    CondVar::~CondVar(void)
    {
      pthread_cond_destroy(&mCondVar);
    }
  };
};
